local require = require
local setmetatable = setmetatable

function class(base)
	-- place class interface and 'super' is reserved word
	local c = { super = base } 
	local meta = { __index = c } -- object metatable

	return setmetatable(c, {
		__index = base,
		__call = function(_, ...)
			local obj = setmetatable({}, meta)
			if base and base.ctor then
				base.ctor(obj, ...)
			end
			if c.ctor then
				c.ctor(obj, ...)
			end
			return obj
		end
	})
end